Skip to content

[Backend Tester] Write report progressively #13308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: gh/GregoryComer/119/head
Choose a base branch
from

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Aug 12, 2025

Append to the report file line by line after each test, rather than all at the end. This ensures that report data is available if the test run is aborted or hit with an unrecoverable native crash.

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 12, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13308

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
[ghstack-poisoned]
@GregoryComer GregoryComer marked this pull request as ready for review August 12, 2025 06:12
@GregoryComer GregoryComer requested a review from cccclai as a code owner August 12, 2025 06:12
write_csv_header(f)
_active_session.has_written_report_header = True

write_csv_row(summary, f)
Copy link
Contributor

@digantdesai digantdesai Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies we crash when we run into some failure? Can we try to catch and fail gracefully? Instead of assuming that we can crash anytime.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mainly for memory corruption, which happens in a few cases. It might be possible to catch the SIGSEGV or other native fault, but I don't know what state the process is it, so I'm not sure if it's recoverable. Open to suggestions.

@@ -262,6 +300,15 @@ def log_test_summary(summary: TestCaseSummary):
if _active_session is not None:
_active_session.test_case_summaries.append(summary)

if _active_session.report_path is not None:
Copy link
Contributor

@digantdesai digantdesai Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can multiple subprocesses write to this simultaneously?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not safely. What is the use case? Are you thinking we parallelize tests between processes? That seems nice to have, though I'd be inclined to deal with concurrency issues if/when we add that feature.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants